<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form" style="margin: 0 auto">
    <fieldset class="layui-elem-field layui-field-title">
    </fieldset>
    <div class="layui-upload-drag" id="test10" style="margin: 0 auto">
        <i class="layui-icon"></i>
        <p>点击上传，或将文件拖拽到此处</p>
        <div class="layui-hide" id="uploadDemoView">
        </div>
    </div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="/static/lib/jq-module/jquery.particleground.min.js" charset="utf-8"></script>
<script src="/static/js/common.js"></script>
<script>
    let customerId = $.common.getUrlParam("customerId");
    layui.use(['upload', 'layer'], function () {
        var upload = layui.upload,
            layer = layui.layer;

        //拖拽上传
        upload.render({
            elem: '#test10'
            , url: '/quotation/uploadFile/'+customerId
            , accept: 'file'
            ,exts:'xlsx'
            , done: function (res) {
                //如果上传失败
                if (res.code != 0) {
                    return $.common.showErrorMessage(res.message);
                } else {
                    $.common.showSuccessMessage(res.message);
                }
            }
        });
    });

</script>
</body>
</html>
